﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HoloLens : MonoBehaviour
{
    public bool IsHost = false;

    public Vector3 DeltaPosition(Vector3 position)
    {
        Vector3 v = position - transform.position;
        float x = Vector3.Dot(transform.right, v);
        float y = Vector3.Dot(transform.up, v);
        float z = Vector3.Dot(transform.forward, v);
        return new Vector3(x, y, z);
    }
    public Vector3 DeltaPosition(Transform transform)
    {
        return DeltaPosition(transform.position);
    }
    public Vector3 Position(Vector3 deltaPosition)
    {
        Vector3 position = transform.position;
        position += transform.right * deltaPosition.x;
        position += transform.up * deltaPosition.y;
        position += transform.forward * deltaPosition.z;
        return position;
    }
}
